import type { DSLWidget } from "../../../types";

export const inputDsl: DSLWidget = {
  widgetName: "MainContainer",
  backgroundColor: "none",
  rightColumn: 1118,
  snapColumns: 64,
  detachFromLayout: true,
  widgetId: "0",
  topRow: 0,
  bottomRow: 540,
  containerStyle: "none",
  snapRows: 129,
  parentRowSpace: 1,
  type: "CANVAS_WIDGET",
  canExtend: true,
  version: 36,
  minHeight: 550,
  parentColumnSpace: 1,
  dynamicTriggerPathList: [],
  dynamicBindingPathList: [],
  leftColumn: 0,
  renderMode: "CANVAS",
  isLoading: false,
  children: [
    {
      widgetName: "Table1",
      defaultPageSize: 0,
      isVisibleDownload: true,
      dynamicPropertyPathList: [],
      topRow: 8,
      bottomRow: 36,
      parentRowSpace: 10,
      type: "TABLE_WIDGET",
      defaultSelectedRow: "0",
      parentColumnSpace: 17.28125,
      dynamicTriggerPathList: [{ key: "primaryColumns.action.onClick" }],
      dynamicBindingPathList: [
        { key: "primaryColumns.step.computedValue" },
        { key: "primaryColumns.task.computedValue" },
        { key: "primaryColumns.status.computedValue" },
        { key: "primaryColumns.action.computedValue" },
      ],
      leftColumn: 6,
      primaryColumns: {
        step: {
          index: 0,
          width: 150,
          id: "step",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "text",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDerived: false,
          label: "step",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.step))}}",
        },
        task: {
          index: 1,
          width: 150,
          id: "task",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "text",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDerived: false,
          label: "task",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.task))}}",
        },
        status: {
          index: 2,
          width: 150,
          id: "status",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "text",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDerived: false,
          label: "status",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.status))}}",
        },
        action: {
          index: 3,
          width: 150,
          id: "action",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "button",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDisabled: false,
          isDerived: false,
          label: "action",
          onClick: "{{showAlert(Table1.selectedRow.task,'info')}}",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.action))}}",
        },
        customColumn1: {
          index: 4,
          width: 150,
          id: "customColumn1",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "button",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDisabled: false,
          isDerived: true,
          label: "Delete",
          onClick: "{{showAlert('Hello')}}",
          computedValue: "",
        },
      },
      delimiter: ",",
      derivedColumns: {},
      rightColumn: 36,
      textSize: "PARAGRAPH",
      widgetId: "yd68qpgb0b",
      isVisibleFilters: true,
      tableData: [
        { step: "#1", task: "Drop a table", status: "✅", action: "" },
        {
          step: "#2",
          task: "Create a query fetch_users with the Mock DB",
          status: "--",
          action: "",
        },
        {
          step: "#3",
          task: "Bind the query using => fetch_users.data",
          status: "--",
          action: "",
        },
      ],
      isVisible: true,
      label: "Data",
      searchKey: "",
      version: 1,
      totalRecordsCount: 0,
      parentId: "0",
      isLoading: false,
      horizontalAlignment: "LEFT",
      renderMode: "CANVAS",
      isVisibleSearch: true,
      isVisiblePagination: true,
      verticalAlignment: "CENTER",
      columnSizeMap: { task: 245, step: 62, status: 75 },
    },
  ],
};

export const outputDsl: DSLWidget = {
  widgetName: "MainContainer",
  backgroundColor: "none",
  rightColumn: 1118,
  snapColumns: 64,
  detachFromLayout: true,
  widgetId: "0",
  topRow: 0,
  bottomRow: 540,
  containerStyle: "none",
  snapRows: 129,
  parentRowSpace: 1,
  type: "CANVAS_WIDGET",
  canExtend: true,
  version: 36,
  minHeight: 550,
  parentColumnSpace: 1,
  dynamicTriggerPathList: [],
  dynamicBindingPathList: [],
  leftColumn: 0,
  renderMode: "CANVAS",
  isLoading: false,
  children: [
    {
      widgetName: "Table1",
      defaultPageSize: 0,
      isVisibleDownload: true,
      dynamicPropertyPathList: [],
      topRow: 8,
      bottomRow: 36,
      parentRowSpace: 10,
      type: "TABLE_WIDGET",
      defaultSelectedRow: "0",
      parentColumnSpace: 17.28125,
      dynamicTriggerPathList: [{ key: "primaryColumns.action.onClick" }],
      dynamicBindingPathList: [
        { key: "primaryColumns.step.computedValue" },
        { key: "primaryColumns.task.computedValue" },
        { key: "primaryColumns.status.computedValue" },
        { key: "primaryColumns.action.computedValue" },
      ],
      leftColumn: 6,
      primaryColumns: {
        step: {
          index: 0,
          width: 150,
          id: "step",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "text",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDerived: false,
          label: "step",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.step))}}",
        },
        task: {
          index: 1,
          width: 150,
          id: "task",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "text",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDerived: false,
          label: "task",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.task))}}",
        },
        status: {
          index: 2,
          width: 150,
          id: "status",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "text",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDerived: false,
          label: "status",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.status))}}",
        },
        action: {
          index: 3,
          width: 150,
          id: "action",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "button",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDisabled: false,
          isDerived: false,
          label: "action",
          onClick: "{{showAlert(currentRow.task,'info')}}",
          computedValue:
            "{{Table1.sanitizedTableData.map((currentRow) => ( currentRow.action))}}",
        },
        customColumn1: {
          index: 4,
          width: 150,
          id: "customColumn1",
          horizontalAlignment: "LEFT",
          verticalAlignment: "CENTER",
          columnType: "button",
          textSize: "PARAGRAPH",
          enableFilter: true,
          enableSort: true,
          isVisible: true,
          isCellVisible: true,
          isDisabled: false,
          isDerived: true,
          label: "Delete",
          onClick: "{{showAlert('Hello')}}",
          computedValue: "",
        },
      },
      delimiter: ",",
      derivedColumns: {},
      rightColumn: 36,
      textSize: "PARAGRAPH",
      widgetId: "yd68qpgb0b",
      isVisibleFilters: true,
      tableData: [
        { step: "#1", task: "Drop a table", status: "✅", action: "" },
        {
          step: "#2",
          task: "Create a query fetch_users with the Mock DB",
          status: "--",
          action: "",
        },
        {
          step: "#3",
          task: "Bind the query using => fetch_users.data",
          status: "--",
          action: "",
        },
      ],
      isVisible: true,
      label: "Data",
      searchKey: "",
      version: 1,
      totalRecordsCount: 0,
      parentId: "0",
      isLoading: false,
      horizontalAlignment: "LEFT",
      renderMode: "CANVAS",
      isVisibleSearch: true,
      isVisiblePagination: true,
      verticalAlignment: "CENTER",
      columnSizeMap: { task: 245, step: 62, status: 75 },
    },
  ],
};
